package com.base.cn.platform.os.controller.manage.log;

import com.base.cn.platform.os.common.AdminBaseController;
import com.base.cn.platform.os.service.manage.log.OpLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Map;

/**
 * 后台操作日志Controller
 *
 * @author zjh
 * @create 2018-012-20
 */
@Controller
@RequestMapping("/admin/manage/log")
public class AdminOpLogonController extends AdminBaseController {


    @Autowired
    OpLogService  opLogService;

    @RequestMapping("/querySysLogList")
    public String querySysLogList(){

        return  resultPage("/manage/log/op-log");
    }

    @RequestMapping("/findUserRoleListPage")
    public String findUserRoleListPage(Model model,@RequestBody Map<String,Object> map,@RequestParam(value = "currentPage",required = false,defaultValue = "1") int currentPage){
        Map<String, Object> userRoleListPage = opLogService.findOpLogListPage(map, currentPage, 10);
        model.addAttribute("dataMap",userRoleListPage);
        return  resultPage("/manage/log/op-ajax-log");
    }

}
